<!DOCTYPE html>
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
    <div id="app"></div>

    <script>
      function h(tag, props, children) {
        const element = document.createElement(tag);
        
        if (props) {
          Object.keys(props).forEach(key => {
            element.setAttribute(key, props[key]);
          });
        }
        
        if (children) {
          if (typeof children === 'string') {
            element.textContent = children;
          } else {
            children.forEach(child => {AC
              element.appendChild(child);
            });
          }
        }
        
        return element;
      }

      const app = document.getElementById('app');
      const element = h('h1', { class: 'title' }, 'Hello, world!');
      app.appendChild(element);
    </script>
  </body>
</html>
